package com.vf.cloud.server.mysql;

import com.vf.cloud.common.util.DbUtil;
import com.vf.cloud.server.mysql.server.Server;

public class MySQLServer {
	
	private static volatile MySQLServer INSYANCE;

	private Server server;

	private MySQLServer() {
		server = new Server();
	}

	public static MySQLServer getInstance() {
		if (null == INSYANCE) {
			synchronized (MySQLServer.class) {
				if (null == INSYANCE) {
					INSYANCE = new MySQLServer();
				}
			}
		}
		return INSYANCE;
	}
	boolean isOk=false;
	public boolean run() {
		if (server != null) {
			server.run();
		}

		isOk=server.isRunning();
		if(isOk) {
			DbUtil.init();
		}
		return isOk;
	}

	public boolean isRunning() {
		return server.isRunning();
	}
	
	public boolean isOk() {
		return isOk;
	}


}
